package com.it.service;

import com.it.dao.UserDao;
import com.it.dao.impl.UserDaoImpl;

import java.util.*;

public class UserServiceImpl02 implements UserService{
    private String name;
    private String age;
    private User user;
    private String[] address;
    private List<User> list;
    private Map<String,Object> map;
    private Set<String> set;
    private Properties properties;

    public void setProperties(Properties properties) {
        this.properties = properties;
    }

    public void setList(List<User> list) {//注入list集合
        this.list = list;
    }

    public void setMap(Map<String, Object> map) {//注入map集合
        this.map = map;
    }

    public void setSet(Set<String> set) {//注入set集合
        this.set = set;
    }

    public void setAddress(String[] address) {
        this.address = address;
    }

    public void setUser(User user) {//setter方法注入bean对象
        this.user = user;
    }

    public void setName(String name) {
        this.name = name;
    }//setter方法注入

    public void setAge(String age) {
        this.age = age;
    }


    public void add() {
        UserDao userDao = new UserDaoImpl();
        userDao.add();
    }

    public void update() {
        UserDao userDao=new UserDaoImpl();
        userDao.update();
    }

    @Override
    public String toString() {
        return "UserServiceImpl02{" +
                "name='" + name + '\'' +
                ", age='" + age + '\'' +
                ", user=" + user +
                ", address=" + Arrays.toString(address) +
                ", list=" + list +
                ", map=" + map +
                ", set=" + set +
                ", properties=" + properties +
                '}';
    }
}
